﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace Mvc4WebApiKoTb.Models
{
    public class PersonModel
    {
        [Display(Name = "ID")]
        public int Id { get; set; }

        [Required]
        [DataType(DataType.Text)]
        [Display(Name = "Vorname")]
        public string Vorname { get; set; }

        [Required]
        [DataType(DataType.Text)]
        [Display(Name = "Nachname")]
        [StringLength(10)]
        public string Nachname { get; set; }

        [DataType(DataType.Text)]
        [Display(Name = "Ort")]
        public String Ort { get; set; }

        [DataType(DataType.Date)]
        [Display(Name = "Geburtsdatum")]
        public DateTime Birthdate { get; set; }

        [DataType(DataType.Time)]
        [Display(Name = "Startzeit")]
        public DateTime Starttime { get; set; }

        public void LoadData()
        {
            Vorname = "Johannes";
            Nachname = "Tremor";
            Ort = "Dresden";
            Birthdate = DateTime.Now.AddDays(5);
            Starttime = DateTime.Now.AddDays(-5);
            Id = 0;
        }
    }

    public class PersonenModel
    {
        [Display(Name = "Personen")]
        public IEnumerable<PersonModel> Personen { get; set; }
    }
}